<template>
  <div class="form_container">
    <div class="manage_tip">
      <!-- app车牌减免 -->
    <ModalPanel 
      :visible='isCar'
      title="手机号查询"
      :onCancel="onCancelCar"
      
      :showFooter="false"
      :onOk="onSubmit">
      <div>
        <CarNumber v-if="isCar" @confirms="fecthCard"></CarNumber>
        <div>手机号：<a v-if="phone" style="color: blue; text-decoration: underline;" :href="'tel:'+ phone " >{{phone}}</a>
        <span v-else>未查到手机号</span>
        </div>
      </div>
    </ModalPanel>
    </div>
  </div>
</template>

<script>
import request from "@/tools/request";
import ModalPanel from "@/components/ModalPanel";
import CarNumber from "@/components/CarNumber";
export default {
  name: "mobile",
  components: {
    ModalPanel,
    CarNumber,
  },
  data() {
    return {
      isCar: true,
      phone: ''

    };
  },
  methods: {
    
    async fecthCard(plate){
      const res = await request({
        url: `/without/query/phone?plate=${plate}`,
        method: "GET",
      })
      console.log(plate)
      // let res = {"msg":"success","code":0,"list":["川AA69313"]}
      if(res.code ==0){
        this.phone = res.list[0] 
      }else{
        this.phone = ''
        this.$message.error(res.msg)
      }
    },
    onCancelCar(){},
    onSubmit(){},
  },
  created () {
  },
  mounted(){
    
  },

}
</script>


<style scoped>

</style>